package com.example.shopping.service;

import com.example.shopping.dao.IContentCategoryDao;
import com.example.shopping.pojo.ContentCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;

/*
Create by 苍狼 于 2020/1/16
站在巅峰看世界，
落在深渊思人生。
*/
@Service
public class ContentCategoryServiceImpl implements ContentCategoryService{
    @Autowired(required = false)
    private IContentCategoryDao contentCategoryDao;

    @Override
    public List<ContentCategory> selectContentCategory() {
        return contentCategoryDao.selectContentCategory();
    }

    @Override
    public int deleteContentCategoryById(int id) {
        return contentCategoryDao.deleteContentCategoryById(id);
    }

    @Override
    public int insertContentCategory(ContentCategory contentCategory) {
        return contentCategoryDao.insertContentCategory(contentCategory);
    }

    @Override
    public List<ContentCategory> selectContentCategoryByName(String name) {
        return contentCategoryDao.selectContentCategoryByName(name);
    }

    @Override
    public int updateContentCategoryStatusOpen(int id) {
        return contentCategoryDao.updateContentCategoryStatusOpen(id);
    }

    @Override
    public int updateContentCategoryStatusClose(int id) {
        return contentCategoryDao.updateContentCategoryStatusClose(id);
    }
}
